<template>
<div>
  <div>
    <DatePicker type="date" placeholder="Select date" style="width: 200px"  format="yyyy-MM-dd" @on-change="one"></DatePicker>
  </div>
  <div style="width: 100px;height: 100px;">
    <Upload
      ref="upload"
      :show-upload-list="false"
      :on-success="handleSuccess"
      type="drag"
      action="//dlqt.juyouhx.com/Api/Api/ObjectToOss"
      style="display: inline-block;width:58px;">
      <div style="width: 58px;height:58px;line-height: 58px;">
        <Icon type="ios-camera" size="20"></Icon>
      </div>
    </Upload>
  </div>
  <div>
    <Button type="primary" @click="test1">post请求测试1</Button>
  </div>
 <div style="margin-top: 50px">
   <Button type="primary" @click="test2">post请求测试2</Button>
 </div>
</div>
</template>
<script>
import { createPost } from '@/api/post'
export default {
  name: 'index',
  data () {
    return {
      ss: [],
      url: ''
    }
  },
  methods: {
    one (value) {
      console.log(value, 'date')
      this.ss = value
    },
    test2 () {
      let data = {
        apiName: 'sq4jycyz',
        AAC058: '01',
        AAC002: '210782199810132412',
        AAC003: '于淼',
        AAC004: '1',
        AAC005: '11',
        AAC006: this.ss,
        AAC011: '31',
        AAC017: '2',
        AAC024: '03',
        AAC033: '1',
        AAC009: '21',
        AAC010: '辽宁省北镇市',
        AAB299: '111111111111',
        AAC186: this.ss,
        AAC046: '111111111111',
        BAB305: '111111111111',
        ACC0M3: '1',
        ACC0M7: '否',
        ADC310: '否',
        ACC0MG: this.url,
        ACC0MH: this.ss,
        AAE019: '于淼',
        AAE020: '民政局',
        AAE022: '111111111111',
        AAE036: '2019-10-06 10:10:10'
      }
      console.log(data)
      createPost(data).then(res => {
        console.log(res)
        console.log(res.data.data)
      })
    },
    handleSuccess (file) {
      this.url = file.url
    },
    test1 () {
      let data = {
        apiName: 'sq4jycyznj',
        ACC0M1: '1561211158455',
        AAC182: this.ss,
        AAE001: 2019,
        AAC18A: '11',
        AAC18B: '11',
        AAC18C: '11',
        AAE013: '11',
        AAE011: '11',
        AAE017: '11',
        AAE019: '11',
        AAE020: '11',
        AAE022: '11'
      }
      console.log(data)
      createPost(data).then(res => {
        console.log(res)
        console.log(res.data.data)
      })
    }
  }
}
</script>

<style scoped>

</style>
